package com.powernode.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("page")
public class PageController {
    @RequestMapping("toLogin.action")
    public String toLogin() {
        return "main/login";
    }

    @RequestMapping("toMain.action")
    public String toMain() {
        return "main/main";
    }

    @RequestMapping("toWelcome.action")
    public String toWelcome() {
        return "main/welcome";
    }

    @RequestMapping("toUserManager.action")
    public String toUserManager() {
        return "user/list";
    }

    @RequestMapping("toCustomerManager.action")
    public String toCustomerManager() {
        return "customer/list";
    }

    @RequestMapping("toOutLogin.action")
    public String toOutLogin(HttpSession session) {
        session.invalidate();
        return "main/login";
    }

    @RequestMapping("toUpdateUserPassword.action")
    public String toUpdateUserPassword() {
        return "user/updatePwd";
    }

    @RequestMapping("toUploadUserImg.action")
    public String toUploadUserImg() {
        return "user/uploadUserImg";
    }

    @RequestMapping("toStat.action")
    public String toStat() {
        return "main/stat";
    }
}
